package org.browntooth.app.bluetooth.messaging;

import java.io.UnsupportedEncodingException;

public class BluetoothMessage {
	private final byte[] data;

	public BluetoothMessage(byte[] data) {
		this.data = data;
	}

	public BluetoothMessage(String data) throws UnsupportedEncodingException {
		this.data = data.getBytes("UTF8");
	}

	public byte[] getData() {
		return data;
	}

	public String getDataAsUtf8String() throws UnsupportedEncodingException {
		return new String(data, "UTF8");
	}
}
